<template>
    <div class="box">
        <div class="left">
            <p>请到个人设置中完善主页内容</p>
        </div>
        <div class="right">
            <div class="vip"> <el-button type="warning" class="vipBtn">开通VIP 享更多特权</el-button></div>
            <div class="nums">
                <div class="item">
                    <p class="num">0</p>
                    <p class="title">文章数</p>
                </div>
                <div class="item">
                    <p class="num">0</p>
                    <p class="title">评论数</p>
                </div>
                <div class="item">
                    <p class="num">0</p>
                    <p class="title">学习数</p>
                </div>
            </div>
            <div class="info">
                <h2>账号信息</h2>
                <p class="userId">用户ID:</p>
                <p class="nickName">昵称：{{ user.nickname }}</p>
                <p class="grade">等级：Lv0</p>
                <p class="kMoney">K币：50</p>
                <p class="registerTime">注册时间：{{registerDate}}</p>
            </div>
        </div>
    </div>
</template>

<script>
import {formatMsToDate} from '@/utils/resetTime.js'
export default {
    name: 'Home',
    props: {

    },
    data() {
        return {
            user: localStorage.getItem("user")
                ? JSON.parse(localStorage.getItem("user"))
                : {},
        };
    },
    computed: {
        registerDate(){
            return formatMsToDate(this.user.createTime)
        }
    },
    beforeCreate() {
    },
    created() {

    },
    mounted() {
    },
    watch: {

    },
    methods: {

    },
    components: {

    },
};
</script>

<style scoped lang="less">
.box {
    display: flex;
    justify-content: space-between;

    .left {
        width: 900px;
        height: 482px;
        padding: 16px 15px 24px;
        background-color: #fff;

        p {
            padding: 30px 20px 20px;
        }
    }

    .right {
        width: 282px;
        height: 482px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .vip {
            height: 84px;
            background-color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;

            &Btn {
                width: 250px;
                height: 52px;
                color: #000;
                font-size: 16px;
                font-weight: 600;
            }
        }

        .nums {
            width: 282px;
            height: 107px;
            background-color: #fff;
            display: flex;
            justify-content: space-around;
            align-items: center;

            .item {
                width: 70px;
                height: 55px;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: space-around;

                .num {
                    font-size: 20px;
                }

                .title {
                    font-size: 12px;
                }
            }
        }

        .info {
            height: 262px;
            background-color: #fff;
            padding:0 16px;
            color: #000;
            h2{
                height: 60px;
                line-height: 60px;
                font-size: 20px;
            }
            p{
                height: 35px;
                line-height: 35px;
            }
        }
    }
}
</style>
